home *** CD-ROM | disk | FTP | other *** search
-
- #include "include\stdio.h"
- #include "include\stdlib.h"
- #include "include\string.h"
- #define S1 " "
-
- extern struct usr {
- char name[36]; /* users ASCII name, */
- char city[36]; /* city and state, */
- struct {
- int area; /* message area */
- int msg; /* last msg read */
- } lastmsg[10];
- char pwd[16]; /* what else, */
- int times; /* # times called, */
- int help; /* last help setting, */
- int tabs; /* 1 == expand tabs, */
- int nulls; /* number of nulls */
- int lmsgarea; /* last message area, */
- int more; /* last MORE setting, */
- int priv; /* user privilege level, */
- char ldate[20]; /* last time called, */
- int time; /* time on sys in 1 day */
- unsigned flag; /* various bit flags, */
- unsigned upld; /* total K byte uploaded, */
- unsigned dnld; /* total K bytes downldd, */
- unsigned dnldl; /* download limiting, */
- int files; /* last file area, */
- char width; /* screen width, */
- char len; /* screen length, */
- int credit; /* credit, in cents, */
- int debit; /* debit, in cents, */
- }
-
- go(argc,argv)
- int argc;
- char *argv[];
- {
-
-
- int rec_no,i=0,triage=1;
- FILE *fp;
- static struct usr record;
- char *buffer;
- char source[20];
- unsigned *new_upld,*new_dnld;
- cls();
- if(argc<2) {
- printf("\n\nYou need the Firstname Lastname exactly as it appears in the userlist");
- printf("\nand you need the first letters of each Capitalized as shown.\n\n");
- exit(1);
- }
-
- if( (fp = fopen("user.bbs","r+b"))==0){
- printf("USER.BBS is NOT in the CURRENT directory. Please correct.\n");
- exit(1);
- }
-
- if( fseek(fp,0l,0)==0) {
- buffer = &record;
- if(argc > 2) {
- strcpy(source,argv[1]);
- strcat(source,S1);
- strcat(source,argv[2]);
- }
- else strcpy(source,argv[1]);
- while( (strcmp(source,record.name) != 0)) {
-
- if(fread(buffer,180,1,fp)<1) {
- printf("\n\nSorry, but I cannot seem to find %s.",source);
- exit(1);
- }
-
- i++;
- }
- }
- else {
- printf("Seek error in USER.BBS and Rec-no is %d",i);
- exit(1);
- }
- printf("\nFound %s and the record number is %u.\n",source,i);
- new_upld = record.upld;
- new_dnld = record.dnld;
- while(triage>0 && triage<3) {
- printf(" %s uploaded %u Kbytes and downloaded %u Kbytes.\n",source,new_upld,new_dnld);
- printf("\n\n 0==>Exit 1==>Change Upload Stats 2==>Change Download Stats ==>");
- scanf("%d",&triage);
- if(triage == 1) {
- printf("\n Change uploads from %u Kbytes to ==>",new_upld);
- scanf("%u",&new_upld);
- continue;
- }
- if(triage == 2) {
- printf("\n Change downloads from %u Kbytes to ==>",new_dnld);
- scanf("%u",&new_dnld);
- continue;
- }
- }
- if((new_dnld != record.dnld) || (new_upld != record.upld)) {
- record.dnld = new_dnld;
- record.upld = new_upld;
- fseek(fp,ftell(fp)-180,0);
- fwrite(buffer,180,1,fp);
- }
- fclose(fp);
- }